import java.util.Timer;
import java.util.TimerTask;

public class Myschedule {
    public static void main(String[] args) {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("这是一个计时器!");
            }
        },1000);


    }
}
